home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / begincpp.zip / #2.CPP < prev    next >
C/C++ Source or Header  |  1990-08-04  |  691b  |  59 lines

  1.  
  2. enum bool { false, true, unknown };
  3.  
  4. class boolean {
  5.       bool * var;
  6.   public:
  7.       boolean(bool b) { var = new bool; *var = b; }
  8.       ~boolean() { delete var; }
  9. };
  10.  
  11. class no_constructor {
  12.     bool none;
  13.   public:
  14.      ~no_constructor() {}
  15. };
  16.  
  17. class no_destructor {
  18.     bool none;
  19.   public:
  20.      no_destructor() {}
  21. };
  22.  
  23. class nothing {
  24. };
  25.  
  26. void proc1(void);
  27. void proc2(void);
  28.  
  29. main()
  30. {
  31.     bool           yes = true;
  32.     boolean        test(yes);
  33.     no_constructor x1;
  34.     no_destructor  x2;
  35.     nothing        x3;
  36.  
  37.     proc1();
  38.     proc2();
  39.  
  40.     exit(0); 
  41. }
  42.  
  43. void proc1()
  44. {
  45.     boolean y(false);
  46.  
  47.     return;
  48. }
  49.  
  50. void proc2()
  51. {
  52.     boolean z();
  53.  
  54.     return;
  55. }
  56.  
  57. /* output:
  58.  
  59.  */